﻿using LinqToLfsWorld.Interface;
using System;
using LinqToLfsWorld.Attributes;
using System.Runtime.Serialization;

namespace LinqToLfsWorld
{
	/// <summary>
	/// An entry in the LFS hotlap upload log.
	/// </summary>
	[Serializable]
	[DataContract]
	public class HotlapLogEntry : ILfsWorldEntity
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="HotlapLogEntry"/> class.
		/// </summary>
		public HotlapLogEntry()
		{
			LogFilter = HotlapLogFilter.All;
		}

		/// <summary>
		/// Gets or sets the log filter. This property is queryable.
		/// </summary>
		/// <value>The log filter.</value>
		[PubstatQueryable(false)]
		[DataMember]
		public HotlapLogFilter LogFilter { get; set; }

		/// <summary>
		/// Gets or sets the steering method. This property is queryable.
		/// </summary>
		/// <value>The steering.</value>
		[PubstatQueryable(false)]
		[DataMember]
		public string Steering { get; set; }

		/// <summary>
		/// Gets or sets the start time. This property is queryable.
		/// </summary>
		/// <value>The start time.</value>
		[PubstatQueryable(false)]
		[DataMember]
		public int StartTime { get; set; }

		/// <summary>
		/// Gets or sets the amount of lines returned by the query. This property is queryable.
		/// </summary>
		/// <value>The lines.</value>
		[PubstatQueryable(false)]
		[DataMember]
		public int Lines { get; set; }

		/// <summary>
		/// Gets or sets the id.
		/// </summary>
		/// <value>The id.</value>
		[DataMember]
		public int Id { get; set; }

		/// <summary>
		/// Gets or sets 3-digit track identifier
		/// </summary>
		[DataMember]
		public string TrackIdent { get; set; }

		/// <summary>
		/// Gets the full track name from the <see cref="TrackIdent">TrackIdent</see>.
		/// </summary>
		[DataMember]
		public string TrackName { get; set; }

		/// <summary>
		/// Gets or sets the car.
		/// </summary>
		/// <value>The car.</value>
		[DataMember]
		public string Car { get; set; }

		/// <summary>
		/// Gets or sets the first split time.
		/// </summary>
		[DataMember]
		public TimeSpan Split1 { get; set; }

		/// <summary>
		/// Gets or sets the second split time.
		/// </summary>
		[DataMember]
		public TimeSpan Split2 { get; set; }

		/// <summary>
		/// Gets or sets the third split time.
		/// </summary>
		[DataMember]
		public TimeSpan Split3 { get; set; }

		/// <summary>
		/// Gets or sets the fourth split.
		/// </summary>
		/// <value>The split4.</value>
		[DataMember]
		public TimeSpan Split4 { get; set; }

		/// <summary>
		/// Gets or sets the lap time.
		/// </summary>
		/// <value>The lap time.</value>
		[DataMember]
		public TimeSpan LapTime { get; set; }

		/// <summary>
		/// Gets or sets the hotlap flags.
		/// </summary>
		/// <value>The flags.</value>
		[DataMember]
		public HotlapFlags Flags { get; set; }

		/// <summary>
		/// Gets or sets the timestamp when this hotlap was uploaded.
		/// </summary>
		/// <value>The timestamp.</value>
		[DataMember]
		public DateTime Timestamp { get; set; }

		/// <summary>
		/// Gets or sets the name of the racer.
		/// </summary>
		/// <value>The name of the racer.</value>
		[DataMember]
		public string RacerName { get; set; }

		/// <summary>
		/// Gets or sets the country.
		/// </summary>
		/// <value>The country.</value>
		[DataMember]
		public string Country { get; set; }

		/// <summary>
		/// Gets or sets the position of this hotlap in the hotlap chart.
		/// </summary>
		/// <value>The position.</value>
		[DataMember]
		public int Position { get; set; }

	}
}
